package com.example.canalclientsync;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.ApplicationContext;

@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
public class CanalClientApplication {

	static ApplicationContext context;

	public static void main(String[] args) {
		context = SpringApplication.run(CanalClientApplication.class, args);

		// Runner已经执行，直接退出
		exit();
	}

	// 退出
	public static void exit() {
		if (context != null) {
			int exitCode = SpringApplication.exit(context, () -> 0);
			System.exit(exitCode);
		}
	}

}
